package main

import (
	"fmt"
	"io/fs"
	"net/http"
	"os"
	"path/filepath"

	"mini-app/cmd"
	"mini-app/config/boot"

	_ "net/http/pprof"
)

func main() {

	dir, _ := os.Getwd()
	fmt.Println("Current working directory:", dir) // 检查是否与预期一致
	err := filepath.Walk(dir, func(path string, info fs.FileInfo, err error) error {
		if err != nil {
			return err
		}
		if !info.IsDir() {
			fmt.Println(path)
		}
		return nil
	})
	if err != nil {
		fmt.Printf("遍历目录出错:%v\n", err)
	}
	// 性能分析
	{
		go func() {
			http.ListenAndServe(":50000", http.DefaultServeMux)
		}()
	}
	// 初始化配置
	boot.AppInit()
	// 命令行，如果没有命令参数，则自动执行默认的程序
	cmd.Execute()
}
